import { ElMessageBox } from 'element-plus';

export function useConfirmAction() {
  function confirm(text, successCb, failCb) {
    ElMessageBox.confirm(text, {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning',
    }).then(() => {
      successCb();
    }).catch(() => {
      failCb();
    });
  }
  return {
    confirm,
  };
}
